package org.shaka.db.sqlbuilder.sql;

public class SqlSubSelectAsTable extends SqlSelect implements SqlAsPartial {
    private String as;

    public SqlSubSelectAsTable(String as) {
        this.as = as;
    }

    @Override
    public String asPartial() {
        StringBuilder sb = new StringBuilder();
        sb.append("(");
        super.buildSql(sb);
        return sb.append(")").append(" AS ").append(as).toString();
    }
}
